<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title>搜索页面</title>

    <link href="assets/css/amazeui.css" rel="stylesheet" type="text/css"/>
    <link href="assets/css/admin.css" rel="stylesheet" type="text/css"/>

    <link href="basic/css/demo.css" rel="stylesheet" type="text/css"/>

    <link href="css/seastyle.css" rel="stylesheet" type="text/css"/>

    <script type="text/javascript" src="basic/js/jquery-1.7.min.js"></script>
    <script type="text/javascript" src="js/script.js"></script>
</head>
<body>
<header th:replace="mall/header::header-user"></header>
<nav th:replace="mall/header::header-search"></nav>
<div class="clear"></div>
<b class="line"></b>
<div class="search">
    <div class="search-list">
        <div class="nav-table">
            <div class="long-title">
				<span class="all-goods"
                      th:text="${searchPageCategoryVO==null?'全部分类': searchPageCategoryVO.currentCategoryName}">
					全部分类
				</span></div>
        </div>


        <div class="am-g am-g-fixed">
            <div class="am-u-sm-12 am-u-md-12">
                <div class="theme-popover">
                    <!-- 关键字搜索 -->
                    <th:block th:if="${searchPageCategoryVO==null}">
                        <th:block th:if="${keyword!=null and keyword !=''}">
                            <div class="searchAbout">
                                <span class="font-pale">搜索关键字：</span>
                                <a title="坚果" href="#" th:text="${keyword}">坚果</a>
                            </div>
                        </th:block>


                    </th:block>
                    <th:block th:if="${searchPageCategoryVO!=null}">
                        <ul class="select">
                            <div class="clear"></div>
                            <li class="select-list">
                                <dl id="select1">
                                    <dt class="am-badge am-round"
                                        th:text="${searchPageCategoryVO.secondLevelCategoryName}">品牌
                                    </dt>
                                    <div class="dd-conent">
                                        <th:block
                                                th:each="thirdLevelCategory : ${searchPageCategoryVO.thirdLevelCategoryList}">
                                            <dd th:class="${thirdLevelCategory.categoryName ==searchPageCategoryVO.currentCategoryName? 'select-all selected':''}">
                                                <a th:href="@{${'/search?goodsCategoryId='+thirdLevelCategory.categoryId}}"
                                                   th:text="${thirdLevelCategory.categoryName}">百草味</a></dd>
                                        </th:block>
                                    </div>
                                </dl>
                            </li>
                        </ul>
                    </th:block>
                    <div class="clear"></div>
                </div>
                <div class="search-content">
                    <div class="sort">
                        <li th:class="${orderBy==null || orderBy=='default'?'first':''}"><a
                                th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy=default'}">推荐排序</a>
                        </li>
                        <li th:class="${orderBy=='new'?'first':''}"><a
                                th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy=new'}">新品排序</a>
                        </li>
                        <li th:class="${orderBy=='price'?'first':''}"><a
                                th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy=price'}">价格排序</a>
                        </li>
                    </div>
                    <div class="clear"></div>

                    <ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 boxes">
                        <th:block th:if="${#lists.isEmpty(pageResult.list)}">
                            未查询到商品
                        </th:block>
                        <th:block th:unless="${#lists.isEmpty(pageResult.list)}">
                            <th:block th:each="goods : ${pageResult.list}">
                                <li>
                                    <div class="i-pic limit">
                                        <a th:href="@{'/detail?goodsId='+${goods.goodsId}}" target="_blank">
                                            <img th:src="@{${goods.goodsCoverImg}}" src="images/imgsearch1.jpg"/>
                                        </a>
                                        <p class="title fl" th:text="${goods.goodsName}">【良品铺子旗舰店】手剥松子218g
                                            坚果炒货零食新货巴西松子包邮</p>
                                        <p class="price fl">
                                            <b>¥</b>
                                            <strong th:text="${goods.sellingPrice}">56.90</strong>
                                        </p>
                                    </div>
                                </li>
                            </th:block>
                        </th:block>
                    </ul>
                </div>
                <div class="clear"></div>
                <!--分页 -->

                <th:block th:if="${null != pageResult and !#lists.isEmpty(pageResult.list)}">
                    <ul class="am-pagination am-pagination-right">
                        <li><a
                                th:href="@{${pageResult.currPage==1}?'##':'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage-1}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}"
                                href="#">
                            &laquo; 上一页</a></li>
                        <th:block th:if="${pageResult.currPage-2 >=1}">
							<li><a th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage-2}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}"
								   th:text="${pageResult.currPage -2}">5</a></li>
						</th:block>
                        <th:block th:if="${pageResult.currPage-1 >=1}">
							<li><a th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage-1}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}"
								   th:text="${pageResult.currPage -1}">2</a></li>
						</th:block>

						<li class="am-active"><a href="#" th:text="${pageResult.currPage}">1</a></li>

                        <th:block th:if="${pageResult.currPage+1<=pageResult.totalPage}">
							<li><a th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage+1}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}"
								   th:text="${pageResult.currPage +1}" >2</a></li>
						</th:block>
                        <th:block th:if="${pageResult.currPage+2<=pageResult.totalPage}">
							<li><a th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage+2}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}"
								   th:text="${pageResult.currPage +2}">2</a></li>
						</th:block>

						<li><a href="#" th:href="@{${pageResult.currPage>=pageResult.totalPage}?'##':'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage+1}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}">下一页 &raquo;</a></li>
                    </ul>
                </th:block>


            </div>
        </div>
        <div th:replace="mall/footer::footer-fragment"></div>
    </div>

</div>
<script>
			window.jQuery || document.write('<script src="basic/js/jquery-1.9.min.js"><\/script>');





</script>
<script type="text/javascript" src="basic/js/quick_links.js"></script>

<div class="theme-popover-mask"></div>

</body>

</html>